home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
arexx
/
rxcmanager
/
examples
/
e2aw.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-05-25
|
1KB
|
64 lines
/*
Author: Alfonso Ranieri <alfier@iol.it>
Desription: export to AWeb hot list
Template: KEY,USER/K
Tipical usage: rx e2aw >file
*/
call addlib("rmh.library",0,-30) then exit
call addlib("rxcmanager.library",0,-30) then exit
if ~open("STDERR","CONSOLE:","W") then stderr="STDOUT"
prg=programname("NOEXT")
if ~RMH_ReadArgs("KEY,USER/K") then do
call printfault(ioerr(),prg)
exit
end
if parm.0.flag then k = "#?"parm.0.value"#?"
else k = "#?"
if parm.1.flag then call CMUserData(parm.1.value)
patt.Name = k
patt.WWW = k
patt.Comment = k
num = CMFind("WWW GROUPS","URL","PATT")
if num=1 then call info "No url entry found"
else call info "Found" num "url(s)"
say "@AWeb hotlist"
g=""
p=""
ng=0
do i=0 to num-1
if url.i.Group~=g then do
if g~="" then do
if url.i.Group~=g & url.i.parents="" then call endG
end
say "@GROUP" url.i.Group
ng=ng+1
g=url.i.Group
end
if ~url.i.EmptyGroup then do
say url.i.WWW
say url.i.Name
end
end
call endG
exit
info: procedure expose stderr prg
parse arg msg
call writeln(stderr,prg":" msg)
return
endG: procedure expose ng
do j=0 to ng-1
say "@ENDGROUP"
end
ng=0
return